<?php namespace Summer\Location\Updates;

use Schema;
use October\Rain\Database\Updates\Migration;

class BuilderTableCreateSummerLocationUserAddress extends Migration
{
    public function up()
    {
        Schema::create('summer_location_user_address', function($table)
        {
            $table->engine = 'InnoDB';
            $table->increments('id')->unsigned();
            $table->timestamp('created_at')->nullable();
            $table->timestamp('updated_at')->nullable();
            $table->integer('user_id');
            $table->string('province_code')->nullable();
            $table->string('city_code')->nullable();
            $table->string('area_code')->nullable();
            $table->string('town_code')->nullable();
            $table->integer('is_default')->nullable()->default(0);
            $table->string('address')->nullable();
            $table->string('consignee')->nullable();
            $table->string('phone')->nullable();
        });
    }
    
    public function down()
    {
        Schema::dropIfExists('summer_location_user_address');
    }
}
